<title>测试frmae用基本信息</title>
<script type="text/html" template>
<form class="layui-form"  requrl="{{ serverPath.systemPath + layui.setter.sysLinkPath}}testIframe/get"style="padding: 0px 30px;width: 440px;margin-left: auto;margin-right: auto" lay-filter="testIframeDataForm">

    <div style="margin: 15px 0px;height: 471px;overflow: auto;">
        <div class="layui-form-item">
            <label class="layui-form-label">主键ID</label>
            <div class="layui-input-block">
                <input type="text" name="id"  placeholder="请输入主键ID"
                       autocomplete="off" class="layui-input " maxlength="50" fieldname="id">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">书籍名称</label>
            <div class="layui-input-block">
                <input type="text" name="bookName"  placeholder="请输入书籍名称"
                       autocomplete="off" class="layui-input " maxlength="50" fieldname="bookName">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">书籍作者</label>
            <div class="layui-input-block">
                <input type="text" name="bookAuthor"  placeholder="请输入书籍作者"
                       autocomplete="off" class="layui-input " maxlength="50" fieldname="bookAuthor">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">书籍价格</label>
            <div class="layui-input-block">
                <input type="text" name="bookPrice"  placeholder="请输入书籍价格"
                       autocomplete="off" class="layui-input " maxlength="50" fieldname="bookPrice">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">出版时间</label>
            <div class="layui-input-block">
                <input type="text" name="bookDate"  placeholder="请输入出版时间"
                       autocomplete="off" class="layui-input dateTimeFiled time-init" maxlength="50" fieldname="bookDate">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <input type="text" name="bookNoot"  placeholder="请输入备注"
                       autocomplete="off" class="layui-input " maxlength="50" fieldname="bookNoot">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div style="text-align: center;">
            <a lay-submit lay-filter="testIframe" class="layui-btn btn-n" requrl="{{ serverPath.systemPath + layui.setter.sysLinkPath}}testIframe/save">提交</a>
            <button type="reset" id="closeWindow" class="layui-btn btn-n layui-btn-danger btn-save">取消</button>
        </div>
    </div>
</form>
</script>
<script>

    layui.use(['common','laydate','jquery'], function () {
        var laydate = layui.laydate;
        var $ = layui.jquery;
        var dateTimeFiledLen = $(".dateTimeFiled");
        for(var i=0;i<dateTimeFiledLen.length;i++){
            laydate.render({
                elem: dateTimeFiledLen[i] //指定元素
                ,type: 'date'
                ,trigger: 'click'
            });
        }

        //关闭当前页面
        $("#closeWindow").click(function () {
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        })

        var common = layui.common;
        common.updateForm({
            name:'testIframeDataForm',
            idValue:"${id}",
            primary:"id",
            updateCallback:function (data) {
                if (common.filterRecord(data)) {
                    window.parent.layer.alert(data.msg, function() {
                        window.parent.layer.close(window.parent.index);
                        if(window.parent.parent.layui.index){
                            window.parent.parent.layui.index.render();
                        }else{
                            parent.location.reload();
                        }
                    });
                } else {
                    window.parent.layer.alert(data.msg);
                }
                return false;
            }
        });
    });
</script>
